// https://codeforc.es/contest/1557/problem/A
#include<bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
const int INF = 0x3f3f3f3f;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int t, n;
	cin >> t;
	while (t--)
	{
		double s[maxn], sum = 0;
		double mx = -INF;
		cin >> n;
		for (int i = 0; i < n; i++)
		{
			cin >> s[i];
			sum += s[i];
			mx = max(mx, s[i]);
		}
		printf("%.9f\n", mx+(sum-mx)/(n-1));
	}
 
}

